﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DARE
{
    public class CRadioButtonData : CButtonData
    {
        public CStaticImageData radioButtonIcon;
        public bool isSelected;

        public override void FillDataStructure(CWidget wid)
        {
            CRadioButton w = wid as CRadioButton;
            base.FillDataStructure(wid);
            radioButtonIcon = new CStaticImageData();
            radioButtonIcon.FillDataStructure(w.CRadioButtonIcon);
            isSelected = w.IsSelected;
        }

        public override void FillFromDataStructure(ref CWidget wid, CHUDSystem hud)
        {
            base.FillFromDataStructure(ref wid, hud);
            CHudTexture tex = new CHudTexture();
            radioButtonIcon.image.FillFromDataStructure(tex);
            (wid as CRadioButton).CRadioButtonIcon.Texture = tex;
            (wid as CRadioButton).IsSelected = isSelected;
        }
    }
}
